package Climb;

import lombok.Data;

@Data
public class ClimbThread extends Thread{
    private int num;
    private long time;

    public ClimbThread(int num, long time) {
        this.num = num/100;
        this.time = time;
    }

    @Override
    public void run() {
        for (int i =0 ; i < num; i++) {
            try {
                System.out.println(Thread.currentThread().getName()+"爬了100米");
                Thread.sleep(time);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println(Thread.currentThread().getName()+"爬完了");
    }
}
